<template>
  <span class="text-right">
    <el-button size="mini" type="default" @click="exportTakeDeliveryInfo"
      ><span :data-clipboard-text="waybillNo" style="color:#468e70">
        导出全部</span
      ></el-button
    >
  </span>
</template>

<script>
import axios from "axios";
import * as constant from "@/store/yg/common/constant";
import { ajax, actionPermission } from "@/store/yg/common/utils";
import { m } from "@/store/yg/common/local";
export default {
  data() {
    return {
      waybillNo: "",
      arr: []
    };
  },

  methods: {
    m(val) {
      return m(val);
    },
    exportTakeDeliveryInfo() {
      var params = {};
      params.queryModel = this.$store.state.main.seek.seeds;
      params.queryModel.waybillNo = this.$store.state.main.seek.seeds[
        "waybills.waybillNo"
      ];
      console.log(params);
      ajax("exportAllTakeDeliveryInfo", params).then(
        res => {
          this.fullscreenLoading = false;
          if (null != res.message && res.message != "") {
            this.$message.error(m(res.message));
          } else {
            var path = constant.FILE_SERVER + res.path;
            location.href =
              constant.API_SERVER +
              "/open/downloadFileByHttp?fileName=" +
              res.fileName +
              "&path=" +
              path;
          }
        },
        error => {
          console.log(error);
        }
      );
    }
  },
  mounted() {}
};
</script>

<style></style>
